<template>
    <div>
        <h1>vuex版本的计数器</h1>
        <h2>{{$store.state.count}}</h2>--- <h2 style="color:red">{{$store.getters.doubleCount}}</h2>
        <h2 style="color:green">{{$store.getters.doubleCount}}</h2>
        <button @click="add">异步+4</button>
    </div>
</template>

<script>
export default {
    methods:{
        add(){
            this.$store.dispatch('increment_count_async',4)
        }
    }
}
</script>

<style>

</style>